# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=weirdaal
pkgver=331.c14e36d
pkgrel=8
pkgdesc='AWS Attack Library.'
groups=('blackarch' 'blackarch-webapp' 'blackarch-scanner' 'blackarch-fuzzer')
arch=('any')
url='https://github.com/carnal0wnage/weirdAAL'
license=('custom:unknown')
depends=('python' 'python-boto3' 'python-botocore' 'python-docutils'
         'python-jmespath' 'python-dateutil' 'python-s3transfer' 'python-six'
         'python-tabulate')
makedepends=('git')
source=("$pkgname::git+https://github.com/carnal0wnage/weirdAAL.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  rm README.md

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python weirdAAL.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

